.TH str_to_gensio_accepter 3 "27 Feb 2019"
.SH NAME
str_to_gensio_accepter \- Create a gensio accepter from a string
.SH SYNOPSIS
.B #include <gensio/gensio.h>
.TP 20
.B int str_to_gensio_accepter(const char *str,
.br
.B                            struct gensio_os_funcs *o,
.br
.B                            gensio_accepter_event cb,
.br
.B                            void *user_data,
.br
.B                            struct gensio_accepter **acc);
.TP 20
.B int str_to_gensio_accepter_child(struct gensio_accepter *child,
.br
.B                            const char *str,
.br
.B                            struct gensio_os_funcs *o,
.br
.B                            gensio_accepter_event cb,
.br
.B                            void *user_data,
.br
.B                            struct gensio_accepter **acc);
.TP 20
.B int gensio_terminal_acc_alloc(const char *gensiotype,
.br
.B const void *gdata,
.br
.B                            const char * const args[],
.br
.B                            struct gensio_os_funcs *o,
.br
.B                            gensio_accepter_event cb, void *user_data,
.br
.B                            struct gensio_accepter **accepter);
.TP 20
.B int gensio_filter_acc_alloc(const char *gensiotype,
.br
.B                          struct gensio_accepter *child,
.br
.B                          const char * const args[],
.br
.B                          struct gensio_os_funcs *o,
.br
.B                          gensio_accepter_event cb, void *user_data,
.br
.B                          struct gensio_accepter **accepter);
.SH "DESCRIPTION"
.B str_to_gensio_accepter
allocates a new gensio accepter stack based upon the given string
.B str.

.B str_to_gensio_accepter_child
allocates a new gensio accepter stack based upon the given string
.B str
and stacks it on top of the given child accepter.

To allocate an accepter directly, use one of
.B gensio_terminal_acc_alloc
or
.B gensio_filter_acc_alloc.
A terminal accepter is one at the bottom of the stack.  The
.B gdata
parameter depends on the particular gensio.  For instance, for tcp it
is a pointer to a gensio_addr structure.  For stdio it is an argv
array.  See gensio.5 under "Direct Allocation" for the particular
gensio for what gdata is.

A filter accepter is one that has a child.  You can use these two
functions to allocate an accepter stack directly, not using a string
format.

The
.B cb
and
.B user_data
parameters set a function that will be called when events come in on
the gensio accepter.
.B user_data
is unused by the gensio stack itself, it is there for the user and may
be anything the user wishes.

The new gensio accepter is returned in
.B acc.
It will be in the shutdown state.
.SH "RETURN VALUES"
Zero is returned on success, or a gensio error on failure.
.SH "SEE ALSO"
gensio_acc_set_callback(3), gensio_err(3), gensio(5)
